﻿Imports System.Data.OleDb
Public Class Register
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RegisterUser.ContinueDestinationPageUrl = Request.QueryString("ReturnUrl")
        Dim conn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("BookMeetConnString").ConnectionString)
        Dim cmd As New OleDbCommand("SELECT TOP 1 * FROM [FamousQuotes] ORDER BY rnd(INT(NOW*id)-NOW*id)", conn)
        conn.Open()
        Dim dr As OleDbDataReader
        dr = cmd.ExecuteReader()
        dr.Read()
        QuoteOfTheDay.Text = dr("Quote").ToString
        Author.Text = dr("SourceTitle").ToString
        dr.Close()
    End Sub

    Protected Sub RegisterUser_CreatedUser(ByVal sender As Object, ByVal e As EventArgs) Handles RegisterUser.CreatedUser
        Response.Redirect("~/Account/displayName.aspx")
    End Sub
End Class